New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

marchingsquares

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marchingsquares

MarchingSquaresJS - An implementation of the Marching Squares algorithm featuring Isocontour and Isoband computation.

  • 1.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is marchingsquares?

The 'marchingsquares' npm package is a JavaScript implementation of the Marching Squares algorithm, which is used for contouring and isoline generation in 2D scalar fields. It is commonly used in data visualization to create contour lines or heatmaps from a grid of data points.

What are marchingsquares's main functionalities?

Contour Line Generation

This feature allows you to generate contour lines from a 2D array of data points. The code sample demonstrates how to use the 'isoContours' function to generate contour lines at a specified threshold value.

const MarchingSquares = require('marchingsquares');

const data = [
  [0, 1, 2, 3],
  [1, 2, 3, 4],
  [2, 3, 4, 5],
  [3, 4, 5, 6]
];

const threshold = 2.5;
const contours = MarchingSquares.isoContours(data, threshold);
console.log(contours);

Heatmap Generation

This feature allows you to generate heatmaps by creating bands of values between specified thresholds. The code sample demonstrates how to use the 'isoBands' function to generate a heatmap from a 2D array of data points.

const MarchingSquares = require('marchingsquares');

const data = [
  [0, 1, 2, 3],
  [1, 2, 3, 4],
  [2, 3, 4, 5],
  [3, 4, 5, 6]
];

const heatmap = MarchingSquares.isoBands(data, 1, 5);
console.log(heatmap);

Other packages similar to marchingsquares

Keywords

FAQs

Package last updated on 28 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc